home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
MacWorld 1999 January - Disc 2
/
Macworld (1999-01) (Disk 2).dmg
/
Serious Demos
/
Symbolic Composer 4.2
/
Environment
/
Projects
/
Tutorial Material
/
Zone Tutorial
/
Structure Examples
/
5. Struct1
< prev
next >
Wrap
Lisp/Scheme
|
1998-10-26
|
2KB
|
58 lines
; STRUCT1 - solo piano (phrase 1)
(setq tonal (activate-tonality (chromatic c 3)))
(setq tonal1 (activate-tonality (chromatic c 4)))
(setq tonal2 (activate-tonality (chromatic c 5)))
(setq tonal3 (activate-tonality (whole-tone c 6)))
(setq sym1 '(l k a c))
(setq sym2 (gen-random 0.4 8 sym1))
(setq sym3 '(= b c e f lc -b ka -b -c))
(setq sym4 (gen-random-variate 0.4 0.07 -3 3 sym3))
; Nigel has been using tick value 96 for 1/4 note.
; Because Nigel often mixes ticks and ratios, the function must take
; both cases into account.
(defun use-nigel-ticks (l)
(let (out)
(dolist (x l)
(if (is-length-symbol x)
(push x out)
(push (* x 5) out)))
(nreverse out)))
(setq rhy1 (use-nigel-ticks '(1/8 1/8 -1/8t 1/8t 1/8t 1/16 1/16 1/16 1/16)))
(setq rhy2 (use-nigel-ticks (gen-loop '((1 5 1) (2 5 1))
'(-1/8-5 1/8-5 1/8-5 1/8-5 1/8-5 1/8-5))))
(setq rhy3 (use-nigel-ticks '(1/2 1/16 -1/2)))
(setq rhy4 (use-nigel-ticks (gen-loop '((1 4 1) (2 5 2)) '(-1/32 1/32 1/32 1/32 1/32))))
(def-symbol
p1 sym2
p2 sym1
p3 sym4
p4 sym3
p5 '(aelsx)
p6 (find-change (gen-fibonacci-trans 4 sym1 sym2))
)
(def-length
p1 (use-nigel-ticks '(1/16 1/16 1/16 1/16 -1/16 1/16 -1/16 1/16
1/16 1/16 1/16 -1/8 1/16 1/16))
p2 (use-nigel-ticks '(1/8 -1/8 1/8 1/8 -1/8 1/8 1/8 1/8))
p3 rhy1
p4 rhy2
p5 rhy3
p6 rhy4
)
(compile-song-p "ccl;output:" 1/4 "piano"
; !---!---!---!---!---!---!---!---!---
p1 tonal " --- - -- - "
p2 tonal3 " ---- - -- - "
p3 tonal1 " --- -- "
p4 tonal2 " -- --- -- "
p5 tonal "-- - "
p6 tonal2 " --- ---- "
)